<template>
  <div id="box">
       <div class="top">

           <el-input v-model="input" placeholder="输入要查询的管理员名称"  class="input"  />
             <el-button type="primary">查询</el-button>
               <el-button type="success">添加</el-button>
                   <el-button type="danger">删除</el-button>
       </div>

       <div class="center">

         <el-table
    ref="multipleTableRef"
    :data="tableData.list"
    style="width: 100%"

    border
  >
    <el-table-column type="selection" width="55" />
    <el-table-column   property="admin_name" label="管理员名称" width="120" />


     <el-table-column property="department" label="部门" width="120" />
    <el-table-column property="is_use" label="角色" width="120" />
     <el-table-column property="real_name" label="真实姓名"  />
      <el-table-column property="mobile" label="手机号"  />
       <el-table-column property="email" label="邮箱"  />
        <el-table-column property="desc" label="备注"  />
 

     <el-table-column fixed="right" label="操作" >
      <template #default="scope">
    





 <el-button type="success">添加</el-button>
   <el-button type="danger" @click="deleteRow(scope.row.admin_id
)">删除</el-button>
     <el-button type="info">详情

     </el-button>




      </template>
    </el-table-column>
  </el-table>


       </div>


  </div>
</template>

<script lang="ts" setup>

import {adminlist,admindel} from '../../api/Administrator/adminlist'
import { onMounted, ref ,reactive} from 'vue'

const input = ref('')


const tableData = reactive({
  list: [],
});



  


  const list=async()=>{
    const res=await adminlist()
    console.log(res);
    tableData.list=res.data
 
    
  }

  const deleteRow=async(admin_id: any)=>{
    console.log(admin_id);
    const res=await admindel({admin_id})
    console.log(res);
    list()
  }

  onMounted(()=>{
      list()
  })

</script>

<style lang="less" scoped>
@import url("../../assets/css/Administrator/adminlist.less");
</style>